
def user = session.user 
if(params.currentPassword == null || params.currentPassword == '') {
	println 'Current Password should not be empty...'
	return
}
if(params.currentPassword != user.password) {
	println 'Your current passord is not same as store password..'
	return
}
if(params.newPassword == null || params.newPassword == '') {
	println 'New Password should not be empty...'
	return
}
if(params.retypeNewPassword == null || params.retypeNewPassword == '') {
	println 'Retype New Password should not be empty...'
	return
}
if(params.newPassword != params.retypeNewPassword) {
	println 'New password and Retype New Password should same...'
	return
}
Date now = new Date()
user.password = params.newPassword
user.updatedTime = now
user.save()

session.user = user

println 'Passwod updated successfully...'

